package com.joysuch.wwyt.mh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.joysuch.wwyt.mh.bean.MhMajorHazardTaskSearchBean;
import com.joysuch.wwyt.mh.bo.MhMajorHazardTaskPageBO;
import com.joysuch.wwyt.mh.entity.MhMajorHazardTask;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zqw
 * @since 2022-05-24
 */
@Repository
public interface MhMajorHazardTaskMapper extends BaseMapper<MhMajorHazardTask> {

    Page<MhMajorHazardTaskPageBO> selectByPage(@Param("page") Page<MhMajorHazardTaskPageBO> page, @Param("currentUserId") Long currentUserId,@Param("orgCode") String orgCode,
                                               @Param("tenentId") Long tenentId, @Param("searchBean") MhMajorHazardTaskSearchBean searchBean);

    List<MhMajorHazardTask> selectTaskByPlanId(@Param("planId") Long planId);

    int deleteTaskByIds(@Param("ids") List<Long> ids);

    List<MhMajorHazardTask> findUnFinishedTasksByPlanId(@Param("planId")Long planId);

    List<MhMajorHazardTask> findAllUnFinishedTasks(@Param("currentDate")Date currentDate);

    Long findByAssignTaskId(@Param("assignTaskId")Long assignTaskId);


    String findByPlanId(Long id );

    List<MhMajorHazardTask> findByIdList(@Param("taskIds") List<Long> taskIds);

    List<Long> findAssignIdsByMhId(@Param("id") Long id);
}
